package com.eh.strategy;

import com.eh.strategy.behavior.impl.FlyRocketPowered;
import com.eh.strategy.behavior.impl.Squeak;
import com.eh.strategy.model.Duck;
import com.eh.strategy.model.MallardDuck;

/**
 * Created by David on 2016/4/22.
 */
public class MiniDuckSimulator {
    public static void main(String[] args) {
        Duck duck = new MallardDuck();
        duck.swim();
        duck.display();
        duck.performFly();
        duck.performQuack();
        System.out.println("-----------变形-------");
        duck.setFlyBehavior(new FlyRocketPowered());
        duck.setQuackBehavior(new Squeak());
        duck.performFly();
        duck.performQuack();
    }
}
